Skip to content

Make numPages host device#300

Merged
chillenzer merged 1 commit intoalpaka-group:devfrom
ikbuibui:patch-2
Mar 11, 2026
Merged

Make numPages host device#300
chillenzer merged 1 commit intoalpaka-group:devfrom
ikbuibui:patch-2

Conversation

@ikbuibui
Copy link
Copy Markdown
Contributor

/__w/spearhed/spearhed/thirdParty/picongpu/thirdParty/mallocMC/include/mallocMC/creationPolicies/FlatterScatter.hpp:420:60: error: reference to __device__ function 'numPages' in __host__ function
  420 |             auto numPagesPerBlock = MyHeap::MyAccessBlock::numPages();
      |                                                            ^
/__w/spearhed/spearhed/thirdParty/picongpu/thirdParty/mallocMC/include/mallocMC/allocator.hpp:148:38: note: called by 'alloc<alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRt<alpaka::ApiCudaRt, false>>'
  148 |             CreationPolicy::template initHeap<AlpakaAcc>(
      |                                      ^
/__w/spearhed/spearhed/thirdParty/picongpu/thirdParty/mallocMC/include/mallocMC/allocator.hpp:197:13: note: called by 'destructiveResize<alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRt<alpaka::ApiCudaRt, false>>'
  197 |             alloc(dev, queue, size);
      |             ^
/__w/spearhed/spearhed/include/spearhed/control/Simulation.x.cpp:219:21: note: called by 'init'
  219 |         deviceHeap->destructiveResize(alpakaDevice, alpakaQueue, small_heap);

I run into the error when using clang as the CUDA compiler.

```
/__w/spearhed/spearhed/thirdParty/picongpu/thirdParty/mallocMC/include/mallocMC/creationPolicies/FlatterScatter.hpp:420:60: error: reference to __device__ function 'numPages' in __host__ function
  420 |             auto numPagesPerBlock = MyHeap::MyAccessBlock::numPages();
      |                                                            ^
/__w/spearhed/spearhed/thirdParty/picongpu/thirdParty/mallocMC/include/mallocMC/allocator.hpp:148:38: note: called by 'alloc<alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRt<alpaka::ApiCudaRt, false>>'
  148 |             CreationPolicy::template initHeap<AlpakaAcc>(
      |                                      ^
/__w/spearhed/spearhed/thirdParty/picongpu/thirdParty/mallocMC/include/mallocMC/allocator.hpp:197:13: note: called by 'destructiveResize<alpaka::DevUniformCudaHipRt<alpaka::ApiCudaRt>, alpaka::uniform_cuda_hip::detail::QueueUniformCudaHipRt<alpaka::ApiCudaRt, false>>'
  197 |             alloc(dev, queue, size);
      |             ^
/__w/spearhed/spearhed/include/spearhed/control/Simulation.x.cpp:219:21: note: called by 'init'
  219 |         deviceHeap->destructiveResize(alpakaDevice, alpakaQueue, small_heap);
```
I run into the error when using clang as the CUDA compiler.
@chillenzer chillenzer merged commit fb5f1da into alpaka-group:dev Mar 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants